<% form.object.build_user if form.object.user.nil? %>

<tr id="permission_<%= form.object.id %>">
	<td class="left">		
		<% form.fields_for :user do |permission_form| %>
			<% if permission_form.object.new_record? %>
				<%= permission_form.text_field :email, :class => "medium" %>
			<% else %>
				<%= permission_form.object.email %>
			<% end %>
		<% end %>
	</td>
	
	<td><%= form.check_box :admin, {:disabled => current_user == form.object.user} %></td>
	
	<td>
		<% if form.object.user.new_record? %>
			<%= link_to content_tag(:span, t(:remove, :scope => :form), :class => "icon cross"), "#", :class => "remove-permission awesome smallest red" %>
		<% else %>
			<% unless form.object.user == current_user %>
				<%= link_to content_tag(:span, t(:remove, :scope => :form), :class => "icon cross"), project_permission_url(form.object.project, form.object), :class => "delete-link awesome smallest red", :confirm_message => t(:remove, :scope => [:form, :hints]) %>
			<% end %>
		<% end %>
	</td>
</tr>